About the "Breakout SMOL grid" / "No container grid"
It can be useful to have a system in place that's easy to go full-width, or have a "breakout" section for calls to action or blockquotes, or other things you want to call attention to.
Traditionally, we use a container or wrapper, which we need to close, and then open again, but thanks to grid, and with the recent additions of subgrid to all the evergreen browsers, maybe there's a better way to do things?
It has it's downsides, as the code is more complex, and it's not as obvious how it works when we're so used to the old pattern.
That said, we shouldn't limit ourselves just because we are used to working in a specific way.
This section has a different background-color
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quibusdam voluptates vitae reiciendis corporis molestias aspernatur vero eaque obcaecati neque dolores veritatis repudiandae voluptas consectetur voluptatum nobis maiores doloremque, nostrum deleniti!
Aspernatur, dignissimos. Quaerat corporis, itaque porro dolore ea a placeat molestiae nihil voluptatem veniam facere, corrupti in vel, voluptates enim soluta sint dolores? Quaerat laboriosam iusto voluptatem accusantium ex alias?
Back to normal
To improve user experience, it's adviced to not overuse this type of resources, as the constant breakout feels as distracting as annoying. Avoid breakout the text line too frequently (as you can see right now).
A thumb of rule could be that the higger difference in witdh a breakout element has, the lesser its frequency of use should be.
In contrast, movile experience doesn't have this type of issues as the layout collaps and this types of breakouts get more nuanced (even full-width elements). Regardless of this, use it discreetly.
Images as full-bleed doesn't work on desktop..
In desktop and wider screens, any element with the utilitarian class "full-width" will appear clipped as they will never meet the sides of the viewport; they are surrounded by two asides. In order to mask this error, a border radius is being applied to make it appear as a constrained element.
The same thing happens if a background color utility class is applied. And for the sake of consistency, this rule also applies to breakout elements.
Eligendi ea maiores asperiores sed nobis qui, animi sint? Ratione laboriosam cum quasi repudiandae in, necessitatibus veritatis nihil perferendis maiores consequuntur magnam perspiciatis minus est quibusdam, voluptate voluptas natus corporis.
Vero, facilis! Animi quam dolor a sunt, quae placeat perspiciatis quia odio quisquam at tempore dolorem eum ratione vel minima eaque repellendus dolores architecto necessitatibus velit reprehenderit amet et rem.
Quos, animi expedita facere iste soluta accusamus et facilis, temporibus nemo praesentium iusto aliquam voluptas magnam pariatur blanditiis optio, corporis laborum quas? Quis libero aperiam est fuga veniam eos tenetur?
Display options for 3D models:
If you have to display a collection, the ideal way is to present each object in a self-contained space. Everything displayed in this card has to be related to the object displayed.
Card's product
There are 2 containers inside a card, one for product's 'description' and another for its 'display. When viewport reaches 960px wide, it changes from 1 column to a 2 column layout.
Viewport and aspect ratio
By default model-viewer components have an aspect ratio of 1:1. Height is the main attribute that this component will take into consideration to calculate its own size.
Aspect ratio issues
What was said before means that, wider objects will produce unwanted margins in the Y axis; above and below the object.
This is more noticeable in 1 column layouts. And as AR features are only displayed on movile devices, it's not a good thing to let it happen.
Wrapper & utilitarian classes
Model-viewer components doesn't have a default size. They inherit its size from its parent container.
This means that we can use a '.wrapper' to manipulate it's size and aspect ratio via utilitarian classes (remember that by default viewports are square by default).
Wrapper and aspect ratio
Just add one of the following classes wherever the 'product' class lives.
- '.wide' = 3:2
- '.wider' = 2:1
- '.narrow' = 2:3
- '.narrower' = 1:2
Model-viewer attributes: Zoom
Althought aspect-ratio is now correct, a new problem has arise; our 3D model has shrinked 😱!
As you may guessed, solving the viewport's aspect-ratio issue, it's just half of the solution. Luckily this can be easily solve by adjusting the "zoom" of the virtual camera of the viewport.
This attribute is implicit on the 'camera-orbit' attribute. by default there are 2 values, [X-axis] and [Y-axis], but we can add a third to control the zoom:
Adjusting the zoom
- No value = No zoom
- 50% = doubles the zoom
Sadly there is no way to change this via CSS rules, so it has to be hardcoded. In the future I'll have to craft a JS script.